import { USER_CHANGE_AGE } from '../constants'

const initState = {
  token: '',
  userName: 'ifer',
  age: 18,
}
export default function user(state = initState, action) {
  switch (action.type) {
    case USER_CHANGE_AGE:
      return {
        ...state,
        age: action.payload,
      }
    default:
      return state
  }
}
